home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / CHEMIST / TEDDEMO2.ZIP / SKALSKY.TEX < prev    next >
Text File  |  1990-03-28  |  22KB  |  472 lines

  1. % (fh)--------------------------------------------=  ii.tex        =--
  2. %
  3. %   This file was
  4. %   written  in TU Budapest QTG by= Varga Imre       at= 10-05-89 11:14
  5. %
  6. %   modified in TU Budapest QTG by= Márk Géza        at= 11-05-89 21:19
  7. %
  8. % (fh)----------------------------------------------------------------
  9. %
  10. %       Pál Pacher, Géza Márk, László Udvardi and Imre Varga:
  11. %       Teaching Physics by Means of Computer Modeling,
  12. %       Eighth Summer School on Computing Techniques in Physics,
  13. %       Skalsky dvur, Czechoslovakia, September 1989
  14. %       Proceedings editor: J. Nadrchal, Institute of Physics Praha
  15. %
  16. \magnification=1200
  17. %\nopagenumber
  18. \hsize=15truecm
  19. \vsize=22.0truecm
  20. \baselineskip=0.90truecm plus 0.1truecm
  21. \parindent=1truecm
  22. \centerline {\bf TEACHING PHYSICS BY MEANS OF COMPUTER MODELING}
  23. \vskip 0.2truein
  24. \centerline {P\'al Pacher$^{\dagger }$,
  25.     G\'eza M\'ark$^{\ast\ddagger}$,
  26.     L\'aszl\'o Udvardi$^{\star }$ and Imre Varga$^{\star }$}
  27. \vskip 0.2truein
  28. \centerline {\it $^{\dagger }$Department of Physics, $^{\ast }$
  29.      Department of Atomic Physics,}
  30. \centerline {\it $^{\star }$Quantum Theory Group,}
  31. \centerline {\it Institute of Physics, Technical University, 1521
  32.     Budapest, Hungary.}
  33. \vskip 0.4truein
  34. \noindent {\bf Abstract}
  35. \vskip 0.3truein
  36.     Computer modeling in teaching physics has a growing importance. It
  37.     helps to solve and understand complex physical problems using
  38.     numerical methods, computer simulation and animation. Typical
  39.     examples developed in our institute are presented: the 3--body
  40.     problem, the Van der Pol oscillator, the recursive graphs and the
  41.     problem of the ideal gas simulation. Both the numerical and the
  42.     modeling difficulties are discussed.
  43. \vskip 3truecm
  44. \noindent $^{\ddagger }$proofs should be sent to this author.
  45. \vfill
  46. \eject
  47. \vskip 0.4truein
  48. \noindent {\bf 1. Introduction}
  49. \vskip 0.3truein
  50.     Traditionally physics is divided into two main branches:
  51.     experimental and theoretical physics.
  52.  
  53.     The experimental physicist tries to understand nature by
  54.     performing experiments  on some representative samples. He records
  55.     sample properties which can be precisely measured against
  56.     variables under his control. In order to understand his results
  57.     and to generalize them to other samples he needs the help of a
  58.     theoretician.
  59.  
  60.     The theoretical physicist is not interested in the irrelevant
  61.     details of the experimentalist's samples. By assuming a theory for
  62.     the behavior of real materials, he works out those same properties
  63.     the experimentalists had measured as exactly as possible.
  64.  
  65.     But some properties of the sample might be easy to measure, but
  66.     too difficult for the theoretical physicist to evaluate without
  67.     unreasonable approximations. In other cases theories predict
  68.     interesting consequences that are impossible, or at least very
  69.     hard, to measure.
  70.  
  71.     In both cases a product of our age, {\it computer modeling}, can
  72.     help in solving the problem. The computational physicist uses a
  73.     finite size model, which is a compromise between the accuracy of
  74.     his model and the size of available computer storage and computer
  75.     time. He runs the model and makes ''measurements'' on it.
  76.     These results can be compared with the experiments (if there are
  77.     any), or they themselves are data to compare with theoretical
  78.     predictions. In contemporary physics a number of subjects rely
  79.     more and more on computational physics.
  80.  
  81.     Computer modeling is, of course, not less important in teaching
  82.     physics. Computer models operating within the framework of
  83.     classical physics can show the students a close-up picture of
  84.     materials. They can reveal why we see various sample-averaged
  85.     properties measured by experiments or calculated by theory.
  86.     Maxwell invented a ''demon'' who could watch the atoms going by.
  87.     Nowadays students can observe the motion of particles on the
  88.     screen of a PC and can open or close the shutter to
  89.     separate atoms with different velocities or other properties and
  90.     follow the entropy change of the process.
  91.  
  92.     At the Faculty of Electrical Engineering of the
  93.     Technical University
  94.     Budapest a new branch, Computer Engineering, has been brought to
  95.     light two years ago. In the third semester the students have to
  96.     write a complex program for practicing the computer languages they
  97.     have already learned, such as Pascal and C. Many students solve
  98.     different problems in physics, most of them by computer modeling.
  99.     Besides developing skills, it also helps them to understand how
  100.     nature works. In what follows we describe some of these programs
  101.     written for IBM compatible PC-s.
  102. \vskip 0.4truein
  103. \noindent {\bf 2. Moons of Saturn}
  104. \vskip 0.3truein
  105.     The simulation of three--body problems is always a big challenge.
  106.     This time the task was the simulation of the motion of the
  107.     co-orbital moons of Saturn discovered by Voyager 1 [1]. These
  108.     moons of approximately the same size and mass follow the same
  109.     orbit with slightly different distance from Saturn. The inner moon
  110.     revolves obviously a bit faster than the outer one. Due to the
  111.     gravitational attraction between the two moons, however, they
  112.     never collide but exchange their orbits when they are close
  113.     enough. The aim of the simulation was to show that the minimum
  114.     distance of the two moons is nonzero.
  115.  
  116.     For the integration of the Newtonian equations, we have used the
  117.     energy conserving algorithm by Greenspan [2]. The algorithm
  118.     involves the solution of the Newtonian equations of motion for the
  119.     interaction
  120.     $$F=-{{G}\over {r}}+{{H}\over {r^n}}-\alpha v,$$
  121.     where the dominant part is the attraction and the repulsive and
  122.     the friction terms are present in order to balance the instability
  123.     problems arising for taking nonzero timesteps. We have chosen
  124.     $G=2250$, $H=1$, $n=3$, $\alpha =10^{-6}$ taken from [2]. We have
  125.     found that Greenspan's algorithm was faster than usual integration
  126.     procedures but the accuracy was considerably lower. The fine
  127.     tuning of the parameters appearing in the force formula may,
  128.     however, improve the results.
  129.  
  130.     As it is shown on Figure 1. the simulation has yielded the
  131.     expected answer: the two moons under consideration never collide
  132.     but approach each other to about $21.5\% $ of their largest
  133.     separation. If we chose $H=0$ we may obtain
  134.     approximatelly the same answer.
  135. \vskip 0.4truein
  136. \noindent {\bf 3. Van der Pol oscillator}
  137. \vskip 0.3truein
  138.     The solution of several physical problems, like the three--body
  139.     problem in classical physics or the problem of
  140.     turbulence, exhibits chaotic properties. One of the historically
  141.     most important  example is the Van der Pol oscillator. It was the
  142.     first system in which the existence of chaotic solutions could be
  143.     proved [3]. The study of the Van der Pol oscillator had
  144.     considerable contribution to the evolution of the theory of
  145.     dynamical systems [4].
  146.  
  147.     We made the oscillator be chaotic using a tunnel diode having
  148.     nonlinear U--I characteristic. See Figure 2.
  149.     A set of coupled ordinary differential equations may
  150.     be derived describing this oscillator [5], where a nonlinear
  151.     function represents the characteristics of a tunnel diode
  152.     appearing in the circuit.
  153.     $$L{{dI}\over {dt}} = {{MS-RC}\over {C}}I + U - V,$$
  154.     $${{dU}\over {dt}} = -{I\over C},$$
  155.     $$C_1{{dV}\over {dt}} = I - f(V),$$
  156.     where function $f(V)$ was chosen as
  157.     $$f(V) =\cases {\alpha (e^{\gamma V}-1), &if $V \leq 0,$ \cr \cr
  158.                          aV^3+bV^2+cV, &if $0 < V \leq V_0,$ \cr \cr
  159.                          e^{\beta (V-V_0)}+d, &if $V > V_0$,}$$
  160.     where the parameters were chosen requiring the existence of the
  161.     first derivative of the function $f(V)$: $\alpha =0.0945A$,
  162.     $\gamma =100V^{-1}$, $a=56.688AV^{-3}$, $b=-53.072AV^{-2}$,
  163.     $c=9.45AV^{-1}$, $\beta = 2.7945V^{-1}$, $V_0=0.787V$, and
  164.     $d = 0.78769A$. In order to solve the set of differential
  165.     equations
  166.     a third order Runge--Kutta procedure using analytical derivatives
  167.     was applied. The waveform of the solutions and the strange
  168.     attractor of the system were determined changing the parameters of
  169.     the oscillator. As one can see on Figure 3. the attractor of the
  170.     system tends to a limitcycle for the following set of parameters
  171.     $$g = {{U}\over {I_m}}\sqrt{{{C}\over{L}}} = 0.05, \qquad
  172.     {{C}\over {C_1}}g = 0.02, \qquad {{MS-RC}\over {\sqrt{LC}}} =
  173.     0.1.$$
  174. \vfill \eject
  175. \vskip 0.4truein
  176. \noindent {\bf 4. Fractal dimension}
  177. \vskip 0.3truein
  178.     Computer modeling is essential in teaching the behavior of
  179.     nonlinear systems. One of the most interesting features
  180.     in such systems is the appearance of fractals, which has also been
  181.     discovered in many other fields of life. Fractals happen to be one
  182.     of the most complicated and yet one of the most beautiful
  183.     mathematical objects as anyone can verify it from the wonderful
  184.     pictures in Mandelbrot's [6] famous book.
  185.  
  186.     The fractal dimension describes the volumetric structure of any
  187.     set of points distributed in real space. It may be used to
  188.     characterize special graphs, strange attractors, i.e. fractals in
  189.     general.
  190.  
  191.     In this program two dimensional recursive graphs have been generated:
  192.     the Sierpinsky carpet, the Sierpinsky graph, the
  193.     Hamilton graph, and the Bethe lattice (see Figure 4.). The fractal
  194.     dimension of these graphs have been calculated by means of the
  195.     basic definition introduced by Hausdorff and Kolmogorov [6]
  196.     $$d=\lim_{n\rightarrow\infty}{{\log (P(n))}\over {-\log(\epsilon
  197.     (n))}},$$
  198.     where $n$ is the fractal index, $P(n)$ is the number of squares
  199.     necessary to cover the $n$-th fractal and $\epsilon (n)=0.5^n$
  200.     is the length of the sides of these squares. Convergence based on
  201.     the definition was fairly slow and the generation of the recursive
  202.     graphs is also a computer consuming task. We have found
  203.     $d=\log (3)/\log (2)$ for the Sierpinski carpet, $d=2$ for the
  204.     Sierpinski graph and the Hamilton graph, and $d=1$ for the Bethe
  205.     lattice.
  206. \vfill \eject
  207. \vskip 0.4truein
  208. \noindent {\bf 5. Ideal Gas Simulation [7]}
  209. \vskip 0.3truein
  210.          Statistical physics is  a profitable field  for computer
  211.     modeling.
  212.     Here  one always  studies a  system consisting of
  213.     many  particles.
  214.     In  a  computer  model  the  microscopic -
  215.     macroscopic metamorphosis is witnessed, i.e., the multi-faced
  216.     behavior of the system is  built up by the motion  of several
  217.     particles governed by simple laws.
  218.  
  219.          The   statistical   physical   simulation   methods  are
  220.     classified  as  {\it  Monte-Carlo} [8]  or {\it molecular
  221.     dynamics } [9,10,11,12,14] techniques. The    Monte-Carlo
  222.     calculations  are  usually  faster  but  the  moves  of   the
  223.     particles  are  artificial  rather  than dynamical.  For this
  224.     reason only the equilibrium properties can be calculated.
  225.  
  226.          In this section we  present an  ideal gas  model based on
  227.     molecular dynamics.  The modelled objects are mass points and
  228.     a  container  made  up  from  various  types  of  walls.  The
  229.     particles  playing   the  role   of  gas   molecules  collide
  230.     elastically  with  each  other.   The  different interactions
  231.     modellized  by  the  different  walls  are represented by the
  232.     corresponding rules for collision against the walls.
  233.  
  234.          This program
  235.     is useful as a visual aid and experimental tool
  236.     in  various  levels  of  education  including  the  following
  237.     topics:
  238.     molecular motion, temperature, first and
  239.     second laws of thermodynamics, speed distribution, fluctuations [13],
  240.     molecule formation, relaxation phenomena.
  241.  
  242.          The program displays on the screen the moving particles
  243.          confined to a rectangular vessel and
  244.     three real time diagrams
  245.     (G1, G2, G3) simultaneously. See Figure 5.
  246.          There are  three types  of particles: red, green
  247.     and invisible ones. The invisible particles are useful when
  248.     you want to concentrate just to certain molecules. (E.g.
  249.     in simulation of gas mixing, see later). Just make those
  250.     molecules visible and the others invisible!
  251.     The particle number and the mass of each particle type can
  252.     be chosen
  253.     independently.  The maximal number of the particles is at
  254.     most 999.
  255.  
  256.         The types of the walls are:
  257.  
  258.         - adiabatic: i.e. the particles collide elastically against
  259.     it,
  260.  
  261.         - diathermic: it can exchange energy both with the
  262.     particles and with the heat reservoir.
  263.  
  264.         The walls can move along the normal or the tangential
  265.     direction to their surface.
  266.     Moreover, a {\it separation wall} can be placed into the
  267.     container. There is a {\it slit} on this wall, the user can
  268.     open or close this slit or put a {\it Maxwell's demon} into the
  269.     slit.
  270.  
  271.          The  on-line  diagrams  can  show  a  variety of distribution
  272.     functions (e.g. pressure, density, temperature versus position,
  273.     histograms of velocity and energy),  time-evolution
  274.     functions (e.g.
  275.     entropy).  Time averaged  distribution functions
  276.     may be displayed, as well.
  277.          Other possible useful features are the {\it shot noise}
  278.     (a clack in every wall-particle collision) and
  279.     {\it particle tracing}
  280.     which shows the path of one particular mass point.
  281. \vskip 0.2truein
  282. \noindent{\it 5.1. Free Expansion of the Gas Into Vacuum}
  283. \vskip 0.1truein
  284.          The particles start from the upper left corner into
  285.     different directions with uniform speed distribution.
  286.          The container is quickly filled up by the particles.
  287.         The velocities will be changed by the collisions and one
  288.     arrives to the Maxwell velocity distribution. Its form in two
  289.     dimensions is given by: $ F(v) = A v e ^ { - v^2 / v_0^2 } $.
  290.         If the collisions of particles with each other are
  291.     switched off
  292.     the velocity
  293.     distribution is kept in its initial form in case of
  294.     adiabatic boundaries.
  295.         When at least one
  296.     boundary is diathermic, however, the energy distribution of
  297.     the gas converges to the energy distribution of the
  298.     reservoir.
  299. \vskip 0.2truein
  300. \noindent{\it 5.2. Mixing of Two Types of Particles}
  301. \vskip 0.1truein
  302.          The green particles start from the upper left corner, the red
  303.     ones start from the opposite  corner.  The initial
  304.     velocity and the mass  of both types may be chosen
  305.     independently. A separation wall with a hole may be
  306.     placed into the container with selectable location and hole size.
  307.          By displaying the velocity distribution in G1 and the
  308.     time-temperature
  309.     functions of the two types of particles in G2  and G3
  310.     the thermalization of the system [16]
  311.     may be observed, i.e. the
  312.     average energy for both types of particles will be the same.
  313.     If the
  314.     greens' mass  is greater  than the  reds' mass,  the greens' average
  315.     velocity will be smaller yielding a two peaked
  316.     velocity distribution (see Figure 5).
  317.  
  318.          The  role of a Maxwell's demon may be played when
  319.     opening or closing the hole on the wall, i.e. the particles may be
  320.     separated to the left and right side of  the container according
  321.     to some attribute (e.q. color, speed).
  322. \vskip 0.2truein
  323. \noindent{\it 5.3. Boltzmann Distribution}
  324. \vskip 0.1truein
  325.          Let's switch the gravitational field on!
  326.  
  327.          If collisions are allowed only against the walls the particles
  328.     move  along  independent  parabolic  paths.   If they start
  329.     with the same speed each particle reaches the same maximal
  330.     height, above that height one gets vacuum.  This strange picture
  331.     is dramatically changed when mutual collisions are permitted.
  332.     Energetic particles reach  high elevations while slow particles
  333.     bounce just on the floor.  The particle density versus height
  334.     may be checked and it proves to be similar to the theoretical
  335.     exponential curve. When for the two types of particles different
  336.     masses are chosen, the lighter ones reach higher elevations due to
  337.     their larger average velocity.
  338. \vskip 0.2truein
  339. \noindent{\it 5.4. Maxwell's Demon}
  340. \vskip 0.1truein
  341.          The demon is sitting in the hole of the separation wall
  342.     dividing the container into two parts.  She lets pass
  343.     particles coming from the left through the hole only if their
  344.     energy is greater than  a  preselected  threshold.
  345.     Particles coming  from the  right are  let through  only with
  346.     energy smaller  than the  threshold.
  347.          When the threshold energy is zero the demon
  348.     operates as a pump. The particles starting from  the upper left
  349.     corner first uniformly fill both sides of the vessel then the
  350.     demon slowly pumps them to the right side.  This strange process
  351.     is shown in Figure 6.
  352. \vskip 0.2truein
  353. \noindent{\it 5.5. Motion of a Piston}
  354. \vskip 0.1truein
  355.          The right wall is pushed into the container then  pulled
  356.     out  again.   The  compression  rate  and the velocity of the
  357.     piston may be selected. Particles colliding against the moving
  358.     piston change their energy leading to heating or cooling  the
  359.     gas. The process is adiabatic, because there is no heat transfer,
  360.     just mechanical work is done.
  361.  
  362.          How much work is done by a given compression?  That  depends
  363.     on the velocity of the piston as it may be demonstrated by
  364.     plotting the average temperature versus  time.  Maximal work  is
  365.     done by  slow, quasistatic piston motion -  one arrives to the
  366.     law [15] $pV^{\kappa} = const$. The work is almost zero  if you
  367.     pull out quickly the piston, because just only a  few  particles
  368.     hit the piston during its motion. In this  case the process  is
  369.     isothermic, i.e. $pV  = const.$
  370. \vfill
  371. \eject
  372. \noindent {\bf References}
  373. \vskip .1truein
  374. \parindent -0.20truecm
  375. \baselineskip=0.80truecm plus 0.1truecm
  376.     1\ R. Gore, National Geographic {\bf 160} (1984) 3
  377.  
  378.     2\ D. Greenspan, SIAM J. Appl. Math. {\bf 20} (1971) 67
  379.  
  380.     3\ M. L. Cartwright, J. E. Littlewood and J. London, Mat. Soc.
  381.     {\bf 20} (1945) 180
  382.  
  383.     4\ N. Levinson, Ann. Math. {\bf 50} (1949) 127; S. Smale, Bull.
  384.     Am. Math. Soc. {\bf 73} (1967) 747; G. Guckenheimer, Physica
  385.     {\bf 1D} (1980) 227
  386.  
  387.     5\ A. S. Pikovsky and M. I. Robinovich, Physica {\bf 2D} (1981) 8
  388.  
  389.     6\ B. Mandelbrot, {\it Fractals: Form, Chance and Dimension} (W.
  390.     H. Freedman, San Francisco, 1977)
  391.  
  392.     7\ E. H. Kennard,
  393.        {\it Kinetic Theory of Gases
  394.        With an Introduction to Statistical Mechanics
  395.        }
  396.        (McGraw-Hill, New York, 1938)
  397.  
  398.     8\ J. Novak and A. B. Bortz,
  399.        Am. J. Phys. {\bf 38} (1970) 1402
  400.  
  401.     9\ P. Empedocles,
  402.        J. Chem. Educ. {\bf 51} (1974) 593
  403.  
  404.    10\ B. J. Adler and T. E. Wainwright,
  405.        J. Chem. Phys. {\bf 31} (1959) 459
  406.  
  407.    11\ {\it Kinetic Theory by Computer Animation}, a film
  408.        produced by J. T. Fitch, J. L. Kinsey and S. F. Martin.
  409.        (Kaima Co., Dept. P 2. Concord, MA 01742.)
  410.  
  411. \noindent
  412.        Reviewed in Am. J. Phys. {\bf 44} (1976) 810
  413.  
  414.    12\ E. T. Lane, {\it Simulated Waves and Paricles}, a program for
  415.        APPLE II.C. (CONDUIT RM 4557, Oakdale Hall,
  416.        The University of Iowa, Iowa City 52242)
  417.  
  418. \noindent
  419.        This program, however, don't model the mutual collisions of
  420.        particles.
  421.  
  422.    13\  J. R. Ray,
  423.         Am. J. Phys. {\bf 50} (1982) 1035
  424.  
  425.    14\  T. Tajima, A. Clark, G. G. Craddock, D. L. Gilden,
  426.         W. K. Leung, Y. M. Li, J. A. Robertson and
  427.         B. J. Saltzman,
  428.         Am. J. Phys. {\bf 53} (1985) 365
  429.  
  430.    15\  M. I. Sobel,
  431.         Am. J. Phys. {\bf 48} (1980) 877
  432.  
  433.    16\  J. Berger,
  434.         Am. J. Phys. {\bf 56} (1988) 923
  435. \vfill
  436. \eject
  437. \noindent {\bf Figure Captions}
  438. \vskip .1truein
  439. \parindent 0truecm
  440.     Figure 1. Distance of the moons versus time. $R$ is the average
  441.     distance of the moons measured from Saturn. $T$ is the average
  442.     time of the orbits of the moons around Saturn. Model parameters
  443.     were used [2]. (Mass of Saturn $M=10$, masses of the moons $m=0.01$,
  444.     $dt=0.01$, initial distance of the moons from Saturn $R_1=101$
  445.     and $R=99$, $T\approx 132.5$.)
  446. \vskip .2truein
  447.     Figure 2. Scheme of the oscillator and the V--I model characteristics
  448. of the tunnel diode.
  449. \vskip .2truein
  450.     Figure 3. Attractor of the Van der Pol oscillator.
  451.     $X = {{I}\over {I_m}}$, $Y = {{U}\over
  452.     {I_m}}\sqrt{{{C}\over{L}}}$,$Z = {{V}\over {V_m}}$ \hfill \break
  453. \vskip .2truein
  454.     Figure 4. Recursive graphs: {\it a.} Sierpinski carpet, {\it b.}
  455.     Sierpinski graph, {\it c.} Hilbert graph, {\it d.} Bethe lattice.
  456. \vskip .2truein
  457.     Figure 5. Demonstration of thermal equilibrium and
  458.     relaxation. The vessel contains 150 red and 75 green
  459.     particles (colors not shown in this figure).
  460.          Initially they had different temperatures.
  461.          The mass of the green particles is 36 times
  462.     greater than the reds' mass yielding a two peaked velocity
  463.     distribution shown on G1.
  464.          Curves G2 and G3 show the average temperature of the
  465.     green and red particles versus time, respectively.
  466. \vskip .2truein
  467.     Figure 6. Maxwell's demon in action.
  468.          The demon's threshold energy is zero.
  469.          G1 shows the entropy of the system, G2 shows the horizontal
  470.     density distribution.
  471. \bye
  472.